Skip to content

feat(plugins): a directory for music-source plugins - #139

Merged
perminder-klair merged 2 commits into
mainfrom
feat/plugins-directory
Nov 27, 2026
Merged

perminder-klair merged 2 commits into
mainfrom
feat/plugins-directory

Conversation

@perminder-klair

Copy link
Copy Markdown
Contributor

The catalog side of perminder-klair/subwave#2413. The station side, the /plugins page that renders this list, is perminder-klair/subwave#2418. They can merge in either order: a station without #2418 ignores the new plugins key, and one with it shows an empty directory until this merges.

Summary

 .github/
   ISSUE_TEMPLATE/
+    add-plugin.yml            # repo, connects to, pasted manifest, pasted conformance --json
+    report-plugin.yml         # takedown
     config.yml                # + "add your plugin by hand" link
   workflows/
+    plugin-submission.yml     # issue → plugins/<name>.json PR
     build-catalog.yml         # + plugins/** path
     validate-catalog.yml      # + plugins/** path
+plugins/
+  README.md                   # fields, what a listing means, reviewer checklist
+  folder.json                 # seed: the Music folder example
 scripts/build-catalog.mjs     # + buildPlugins(), catalog.plugins

buildPlugins() rules (the workflow mirrors them):

filename == plugin == manifest name   ^[a-z][a-z0-9-]{1,31}$, not navidrome|jellyfin|plex|mock
name (label) ≤60, connectsTo ≤60      required
repo                                  required, https
apiVersion                            positive integer
conformance {pass,warn,fail,skip}     required, whole numbers, fail == 0
description ≤280 · checkedWith x.y.z · submitted yyyy-mm-dd · hostFiles boolean

The submission workflow builds the entry from what's pasted, not from typed fields:

manifest.name → plugin + filename + branch plugin/<name>
manifest.label → name    manifest.apiVersion → apiVersion
report.checks[].outcome → conformance counts
refuse: report.plugin ≠ manifest.name · a failed check · ok ≠ true · name already listed
PR body: the entry + a code-review checklist (hosts, no eval/child_process/remote import,
         file access, manifest matches, README install notes)

The issue body is parsed with JSON.parse inside github-script and never reaches a shell step. Nothing from the plugin's repository is fetched or run.

Evidence

  • node scripts/build-catalog.mjs --check → ✓ catalog valid (… apps=13 plugins=1). The only warning, personas/trevor, was there before.
  • Builder, bad entries (a scratch copy with four of them): it reported all 9 problems and exited 1.
    • a plex.json shadowing a built-in;
    • Bad_Name.json;
    • a plugin that doesn't match its filename, an http repo, apiVersion: 0, checkedWith: "latest", hostFiles: "yes" and fail: 2, all in one entry;
    • an entry with no conformance counts.
  • Workflow script: I extracted it from the YAML and ran it in Node against a fake REST API, with issue bodies shaped like GitHub's form output:
    • The real folder manifest and a real --json report produced a branch, plugins/folder.json, a PR, and built=true. That generated entry passes --check.
    • http repo, empty "Connects to", latest version, a plex manifest, and a report for another plugin with 1 failure got one comment listing all six problems, plus needs-info.
    • A name already listed on main: before the fix it still created a branch; after, it only comments.
    • Manifest that isn't JSON and a report of {}: before the fix it also said "0 failed check(s)"; after, it says the report has no checks.
    • ok: false with no failed checks: comments "not marked "ok": true".
  • Seed counts: npm --prefix router run conformance -- docs/examples/sources/folder --config path=<3 tracks, 2 albums, cover.jpg> --json gave 15 passed, 2 warnings, 0 failed, 6 skipped. The warnings are by design: no durations or genres, since the example reads no tags.
  • Labels: plugin-submission, plugin-report and plugins now exist on this repo, styled like the app labels.

Merge Danger

Door: two-way

Reverting removes the folder and the forms. The bot rebuilds catalog.json without plugins.

Blast Radius: catalog

Adds plugins/, one JSON file per music-source plugin, published in
catalog.json for the /plugins directory every station serves
(perminder-klair/subwave#2413). Seeded with the Music folder example.

build-catalog.mjs validates each entry: the filename is the manifest
name and not a built-in's, the repo is https, the apiVersion is set, and
the conformance counts are present with no failed check.

The add-plugin form takes the pasted manifest and the conformance kit's
--json report; plugin-submission.yml derives the entry from them, turns
away a report for another plugin or one with a failed check, and opens a
PR with a reviewer checklist, since listing a plugin is a review of its
code. report-plugin.yml is the takedown form.
The kit ships in the SDK package (perminder-klair/subwave#2417), so a
plugin author needs no SUB/WAVE checkout. The form, plugins/README.md and
the builder's message lead with the npx command and keep the checkout
route as an alternative.
@perminder-klair
perminder-klair merged commit 0cc9c21 into main Nov 27, 2026
1 check passed
@perminder-klair
perminder-klair deleted the feat/plugins-directory branch November 27, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant